Skip to content

replacing legacy sbt-jacoco#90

Open
MatloaItumeleng wants to merge 6 commits intomasterfrom
feature/89-jacoco-upgrade
Open

replacing legacy sbt-jacoco#90
MatloaItumeleng wants to merge 6 commits intomasterfrom
feature/89-jacoco-upgrade

Conversation

@MatloaItumeleng
Copy link
Copy Markdown
Contributor

Release notes:

  • Upgrades the legacy sbt-jacoco to the latest stable version.

closes #89

@github-actions
Copy link
Copy Markdown

JaCoCo code coverage report - scala 2.12.12

There is no coverage information present for the Files changed

@MatloaItumeleng MatloaItumeleng changed the title replacing replacing legacy sbt-jacoco replacing legacy sbt-jacoco Mar 30, 2026
ABLL526
ABLL526 previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Contributor

@ABLL526 ABLL526 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the only thing is the txt file. Can you remove the comments from it?
Other than that I will approve

@MatloaItumeleng
Copy link
Copy Markdown
Contributor Author

The jmf-rules.txt file acts as a template for the project as part of Morana usage. The workflow will be updated to run coverage. For reference, see: https://github.com/MoranaApps/jacoco-method-filter/blob/master/jmf-rules.template.txt

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

JaCoCo code coverage report - scala 2.12.12

Metric (instruction) Coverage Threshold Status
Overall 81.57% 80.0%
Changed Files 0.0% 80.0%
Report Coverage (O/Ch) Threshold (O/Ch) Status (O/Ch)
spark-data-standardization Jacoco Report - scala:2.12.20 81.57% / 0.0% 80.0% / 80.0% ✅/✅
File Path Coverage Threshold Status

No changed file in reports.

Copy link
Copy Markdown

@TheLydonKing TheLydonKing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just read the code, makes sense to me.

Copy link
Copy Markdown
Contributor

@dk1844 dk1844 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (read the code)

jacocoReportName := s"spark-data-standardization Jacoco Report - scala:${scalaVersion.value}"
jacocoReportFormats := Set("html", "xml")

// jacocoExcludes := Seq("za/co/absa/standardization/udf/UDFBuilder*", "za/co/absa/standardization/udf/UDFNames")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @miroslavpojer we also thinking about excluding some tests using the filter method please have a look for a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my proposal. It filter out UDFName vals. You can place it into Project rules part of jmf-rules.txt file.

# UDFNames object — final val string constant accessors
# UDFNames* matches both UDFNames$ (module) and UDFNames (static forwarders)
za.co.absa.standardization.udf.UDFNames*#stdCastErr()           id:udfnames-stdCastErr
za.co.absa.standardization.udf.UDFNames*#stdNullErr()           id:udfnames-stdNullErr
za.co.absa.standardization.udf.UDFNames*#stdSchemaErr()         id:udfnames-stdSchemaErr
za.co.absa.standardization.udf.UDFNames*#arrayDistinctErrors()  id:udfnames-arrayDistinctErrors
za.co.absa.standardization.udf.UDFNames*#cleanErrCol()          id:udfnames-cleanErrCol
za.co.absa.standardization.udf.UDFNames*#errorColumnAppend()    id:udfnames-errorColumnAppend
za.co.absa.standardization.udf.UDFNames*#binaryUnbase64()       id:udfnames-binaryUnbase64

Copy link
Copy Markdown
Contributor

@miroslavpojer miroslavpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • pulled
  • ran jacoco locally

Comment on lines 25 to 33
lazy val ow2Version = "9.5"
lazy val jacocoVersion = "0.8.10-absa.1"

def jacocoUrl(artifactName: String): String = s"https://github.com/AbsaOSS/jacoco/releases/download/$jacocoVersion/org.jacoco.$artifactName-$jacocoVersion.jar"
def ow2Url(artifactName: String): String = s"https://repo1.maven.org/maven2/org/ow2/asm/$artifactName/$ow2Version/$artifactName-$ow2Version.jar"

addSbtPlugin("com.jsuereth" %% "scala-arm" % "2.0" from "https://repo1.maven.org/maven2/com/jsuereth/scala-arm_2.11/2.0/scala-arm_2.11-2.0.jar")
addSbtPlugin("com.jsuereth" %% "scala-arm" % "2.0" from "https://repo1.maven.org/maven2/com/jsuereth/scala-arm_2.12/2.0/scala-arm_2.12-2.0.jar")

addSbtPlugin("za.co.absa.jacoco" % "report" % jacocoVersion from jacocoUrl("report"))
addSbtPlugin("za.co.absa.jacoco" % "core" % jacocoVersion from jacocoUrl("core"))
addSbtPlugin("za.co.absa.jacoco" % "agent" % jacocoVersion from jacocoUrl("agent"))
addSbtPlugin("org.ow2.asm" % "asm" % ow2Version from ow2Url("asm"))
addSbtPlugin("org.ow2.asm" % "asm-commons" % ow2Version from ow2Url("asm-commons"))
addSbtPlugin("org.ow2.asm" % "asm-tree" % ow2Version from ow2Url("asm-tree"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe all these lines can be removed. They were part of previous jacoco sbt plugin solution.

// jacocoExcludes := Seq("za/co/absa/standardization/udf/UDFBuilder*", "za/co/absa/standardization/udf/UDFNames")

// Command aliases for JaCoCo coverage workflow
addCommandAlias("jacoco", "; jacocoOn; clean; test; jacocoReportAll; jacocoOff")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can be solved using .sbtrc file.
Just mentioning if avoided on purpose.

jacocoReportName := s"spark-data-standardization Jacoco Report - scala:${scalaVersion.value}"
jacocoReportFormats := Set("html", "xml")

// jacocoExcludes := Seq("za/co/absa/standardization/udf/UDFBuilder*", "za/co/absa/standardization/udf/UDFNames")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my proposal. It filter out UDFName vals. You can place it into Project rules part of jmf-rules.txt file.

# UDFNames object — final val string constant accessors
# UDFNames* matches both UDFNames$ (module) and UDFNames (static forwarders)
za.co.absa.standardization.udf.UDFNames*#stdCastErr()           id:udfnames-stdCastErr
za.co.absa.standardization.udf.UDFNames*#stdNullErr()           id:udfnames-stdNullErr
za.co.absa.standardization.udf.UDFNames*#stdSchemaErr()         id:udfnames-stdSchemaErr
za.co.absa.standardization.udf.UDFNames*#arrayDistinctErrors()  id:udfnames-arrayDistinctErrors
za.co.absa.standardization.udf.UDFNames*#cleanErrCol()          id:udfnames-cleanErrCol
za.co.absa.standardization.udf.UDFNames*#errorColumnAppend()    id:udfnames-errorColumnAppend
za.co.absa.standardization.udf.UDFNames*#binaryUnbase64()       id:udfnames-binaryUnbase64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade JaCoCo Integration to modern coverage approach

5 participants